package com.example.service1.common.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
@AllArgsConstructor
@Accessors(chain = true)
public class FileTestDto {
    private String name;
    private long age;
//    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate localDate;
    private List<String> list;
    private MultipartFile multipartFile;
    private List<MultipartFile> fileList;

    public FileTestDto(){
    }

    public static FileTestDto defaultCreate(){
        FileTestDto testDto = new FileTestDto();
        testDto.name = "默认字符串";
        testDto.age = 16L;
        testDto.localDate = LocalDate.now();
        testDto.list = new ArrayList<>(Arrays.asList("元素1","元素2"));
        return testDto;
    }

    @Override
    public String toString() {
        return "FileTestDto{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", localDate=" + localDate +
                ", list=" + list +
                ", multipartFile=" + multipartFile +
                ", fileList=" + fileList +
                '}';
    }
}
